package com.diandiansong.app.entity;

import com.google.gson.annotations.SerializedName;

import java.util.List;

import diandiansong.library.utils.BaseEntity;

public class IndexInfo extends BaseEntity {


    /**
     * message : null
     * data : {"city_name":"","banner":[{"img_url":"http://h3.mobilekoudai.com/uploads/banner.png","link_url":""}],"article":[{"id":"3",
     * "title":"全场五折起，欢迎新老顾客采购"},{"id":"2","title":"特价甩卖特价甩卖"},{"id":"1","title":"8.3号-8.5号大促销"}],"kill_time":"96328","kill_end_time":"23",
     * "kill_info":[{"commodity_id":"7","commodity_name":"小青菜","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-07-26/9ee8e982a89b48308645a3770b693cac94.jpg","kill_price":"0.01","unit":"斤","price":"0.01","stock":"1233",
     * "spec_info":"1斤，2斤，3斤，"},{"commodity_id":"20","commodity_name":"牛肉","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-07-26/9f548e168c38e9f0dc3679f21b1f46bab8.jpg","kill_price":"0.01","unit":"斤","price":"888.00","stock":"345",
     * "spec_info":""},{"commodity_id":"18","commodity_name":"枣","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-07-26/f5748a6723dae5b63a3269223d783e1e78.jpg","kill_price":"0.02","unit":"斤","price":"0.01","stock":"578","spec_info":""},
     * {"commodity_id":"9","commodity_name":"金针菇","imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/45e9ce45d9b1805767a3c3f0e67e54aa43.jpg",
     * "kill_price":"0.04","unit":"斤","price":"0.01","stock":"123","spec_info":"1斤，2斤，3斤，"}],"tj_info":[{"commodity_id":"34","commodity_name":"芋头",
     * "imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/08d5a6a6b94f25045d77e495d3795a1037.jpg","price":"0.01","unit":"斤","spec_info":"1斤"},
     * {"commodity_id":"17","commodity_name":"西瓜","imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/0f97ca8a2504bc84966ae0b7c8272df665.jpg",
     * "price":"0.01","unit":"斤","spec_info":""},{"commodity_id":"35","commodity_name":"空心菜","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-07-26/62067781f3aebb65c16b5942c8d3aa3ae8.jpg","price":"0.01","unit":"斤","spec_info":"小+1斤，2斤，3斤，"},{"commodity_id":"31",
     * "commodity_name":"茅台","imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/42906f132fa0a279e09d2a488983b7916f.jpg","price":"0.01",
     * "unit":"件","spec_info":"小"},{"commodity_id":"28","commodity_name":"东北大米","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-07-26/ba9da062a58483452e08f0f4e9f022fef0.jpg","price":"0.01","unit":"斤","spec_info":""}],
     * "three_info":[{"model":"index_left","title":"天然菜籽油","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-08-02/99feb2bafdc91be560f3973d9a4e13ff99.jpg"},{"model":"index_center","title":"东北大米","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-08-02/d59ff96c481194e5b1a9f7b38443a422cb.jpg"},{"model":"index_right","title":"玉山香菇","imgs":"http://h3.mobilekoudai
     * .com/uploads/2018-08-02/15cd1a44e9e83acdb55cfe8419d1712d66.jpg"}]}
     */

    @SerializedName("data")
    private Data data;

    public Data getData() {
        return data;
    }

    public void setData(Data data) {
        this.data = data;
    }

    public static class Data {
        /**
         * city_name :
         * banner : [{"img_url":"http://h3.mobilekoudai.com/uploads/banner.png","link_url":""}]
         * article : [{"id":"3","title":"全场五折起，欢迎新老顾客采购"},{"id":"2","title":"特价甩卖特价甩卖"},{"id":"1","title":"8.3号-8.5号大促销"}]
         * kill_time : 96328
         * kill_end_time : 23
         * kill_info : [{"commodity_id":"7","commodity_name":"小青菜","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/9ee8e982a89b48308645a3770b693cac94.jpg","kill_price":"0.01","unit":"斤","price":"0.01","stock":"1233",
         * "spec_info":"1斤，2斤，3斤，"},{"commodity_id":"20","commodity_name":"牛肉","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/9f548e168c38e9f0dc3679f21b1f46bab8.jpg","kill_price":"0.01","unit":"斤","price":"888.00","stock":"345",
         * "spec_info":""},{"commodity_id":"18","commodity_name":"枣","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/f5748a6723dae5b63a3269223d783e1e78.jpg","kill_price":"0.02","unit":"斤","price":"0.01","stock":"578",
         * "spec_info":""},{"commodity_id":"9","commodity_name":"金针菇","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/45e9ce45d9b1805767a3c3f0e67e54aa43.jpg","kill_price":"0.04","unit":"斤","price":"0.01","stock":"123",
         * "spec_info":"1斤，2斤，3斤，"}]
         * tj_info : [{"commodity_id":"34","commodity_name":"芋头","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/08d5a6a6b94f25045d77e495d3795a1037.jpg","price":"0.01","unit":"斤","spec_info":"1斤"},{"commodity_id":"17",
         * "commodity_name":"西瓜","imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/0f97ca8a2504bc84966ae0b7c8272df665.jpg","price":"0.01",
         * "unit":"斤","spec_info":""},{"commodity_id":"35","commodity_name":"空心菜","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/62067781f3aebb65c16b5942c8d3aa3ae8.jpg","price":"0.01","unit":"斤","spec_info":"小+1斤，2斤，3斤，"},
         * {"commodity_id":"31","commodity_name":"茅台","imgs":"http://h3.mobilekoudai.com/uploads/2018-07-26/42906f132fa0a279e09d2a488983b7916f
         * .jpg","price":"0.01","unit":"件","spec_info":"小"},{"commodity_id":"28","commodity_name":"东北大米","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-07-26/ba9da062a58483452e08f0f4e9f022fef0.jpg","price":"0.01","unit":"斤","spec_info":""}]
         * three_info : [{"model":"index_left","title":"天然菜籽油","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-08-02/99feb2bafdc91be560f3973d9a4e13ff99.jpg"},{"model":"index_center","title":"东北大米","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-08-02/d59ff96c481194e5b1a9f7b38443a422cb.jpg"},{"model":"index_right","title":"玉山香菇","imgs":"http://h3.mobilekoudai
         * .com/uploads/2018-08-02/15cd1a44e9e83acdb55cfe8419d1712d66.jpg"}]
         */

        @SerializedName("city_name")
        private String cityName;
        @SerializedName("kill_time")
        private String killTime;
        @SerializedName("kill_end_time")
        private String killEndTime;
        @SerializedName("banner")
        private List<Banner> banner;
        @SerializedName("article")
        private List<Article> article;
        @SerializedName("kill_info")
        private List<KillInfo> killInfo;
        @SerializedName("tj_info")
        private List<TjInfo> tjInfo;
        @SerializedName("three_info")
        private List<ThreeInfo> threeInfo;

        public String getCityName() {
            return cityName;
        }

        public void setCityName(String cityName) {
            this.cityName = cityName;
        }

        public String getKillTime() {
            return killTime;
        }

        public void setKillTime(String killTime) {
            this.killTime = killTime;
        }

        public String getKillEndTime() {
            return killEndTime;
        }

        public boolean isEnableKill() {
            try {
                return killTime != null && Long.valueOf(killTime) > 0;
            } catch (Exception e) {
                e.printStackTrace();
            }
            return false;
        }

        public void setKillEndTime(String killEndTime) {
            this.killEndTime = killEndTime;
        }

        public List<Banner> getBanner() {
            return banner;
        }

        public void setBanner(List<Banner> banner) {
            this.banner = banner;
        }

        public List<Article> getArticle() {
            return article;
        }

        public void setArticle(List<Article> article) {
            this.article = article;
        }

        public List<KillInfo> getKillInfo() {
            return killInfo;
        }

        public void setKillInfo(List<KillInfo> killInfo) {
            this.killInfo = killInfo;
        }

        public List<TjInfo> getTjInfo() {
            return tjInfo;
        }

        public void setTjInfo(List<TjInfo> tjInfo) {
            this.tjInfo = tjInfo;
        }

        public List<ThreeInfo> getThreeInfo() {
            return threeInfo;
        }

        public void setThreeInfo(List<ThreeInfo> threeInfo) {
            this.threeInfo = threeInfo;
        }

        public static class Banner {
            /**
             * img_url : http://h3.mobilekoudai.com/uploads/banner.png
             * link_url :
             */

            @SerializedName("img_url")
            private String imgUrl;
            @SerializedName("link_url")
            private String linkUrl;

            public String getImgUrl() {
                return imgUrl;
            }

            public void setImgUrl(String imgUrl) {
                this.imgUrl = imgUrl;
            }

            public String getLinkUrl() {
                return linkUrl;
            }

            public void setLinkUrl(String linkUrl) {
                this.linkUrl = linkUrl;
            }
        }

        public static class Article {
            /**
             * id : 3
             * title : 全场五折起，欢迎新老顾客采购
             */

            @SerializedName("id")
            private String id;
            @SerializedName("title")
            private String title;

            public String getId() {
                return id;
            }

            public void setId(String id) {
                this.id = id;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }
        }

        public static class KillInfo {
            /**
             * commodity_id : 7
             * commodity_name : 小青菜
             * imgs : http://h3.mobilekoudai.com/uploads/2018-07-26/9ee8e982a89b48308645a3770b693cac94.jpg
             * kill_price : 0.01
             * unit : 斤
             * price : 0.01
             * stock : 1233
             * spec_info : 1斤，2斤，3斤，
             */

            @SerializedName("commodity_id")
            private String commodityId;
            @SerializedName("commodity_name")
            private String commodityName;
            @SerializedName("imgs")
            private String imgs;
            @SerializedName("kill_price")
            private String killPrice;
            @SerializedName("unit")
            private String unit;
            @SerializedName("price")
            private String price;
            @SerializedName("stock")
            private String stock;
            @SerializedName("spec_info")
            private String specInfo;

            public String getCommodityId() {
                return commodityId;
            }

            public void setCommodityId(String commodityId) {
                this.commodityId = commodityId;
            }

            public String getCommodityName() {
                return commodityName;
            }

            public void setCommodityName(String commodityName) {
                this.commodityName = commodityName;
            }

            public String getImgs() {
                return imgs;
            }

            public void setImgs(String imgs) {
                this.imgs = imgs;
            }

            public String getKillPrice() {
                return killPrice;
            }

            public void setKillPrice(String killPrice) {
                this.killPrice = killPrice;
            }

            public String getUnit() {
                return unit;
            }

            public void setUnit(String unit) {
                this.unit = unit;
            }

            public String getPrice() {
                return price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public String getStock() {
                return stock;
            }

            public void setStock(String stock) {
                this.stock = stock;
            }

            public String getSpecInfo() {
                return specInfo;
            }

            public void setSpecInfo(String specInfo) {
                this.specInfo = specInfo;
            }
        }

        public static class TjInfo {
            /**
             * commodity_id : 34
             * commodity_name : 芋头
             * imgs : http://h3.mobilekoudai.com/uploads/2018-07-26/08d5a6a6b94f25045d77e495d3795a1037.jpg
             * price : 0.01
             * unit : 斤
             * spec_info : 1斤
             */

            @SerializedName("commodity_id")
            private String commodityId;
            @SerializedName("commodity_name")
            private String commodityName;
            @SerializedName("imgs")
            private String imgs;
            @SerializedName("price")
            private String price;
            @SerializedName("unit")
            private String unit;
            @SerializedName("spec_info")
            private String specInfo;


            @SerializedName("tourist")
            private String tourist;

            public boolean isTourist() {
                return tourist != null && tourist.equals("1");
            }

            public String getCommodityId() {
                return commodityId;
            }

            public void setCommodityId(String commodityId) {
                this.commodityId = commodityId;
            }

            public String getCommodityName() {
                return commodityName;
            }

            public void setCommodityName(String commodityName) {
                this.commodityName = commodityName;
            }

            public String getImgs() {
                return imgs;
            }

            public void setImgs(String imgs) {
                this.imgs = imgs;
            }

            public String getPrice() {
                if (isTourist()) {
                    return "";
                    //return "--";
                }
                return price;
            }

            public void setPrice(String price) {
                this.price = price;
            }

            public String getUnit() {
                return unit;
            }

            public void setUnit(String unit) {
                this.unit = unit;
            }

            public String getSpecInfo() {
                return specInfo;
            }

            public void setSpecInfo(String specInfo) {
                this.specInfo = specInfo;
            }
        }

        public static class ThreeInfo {
            /**
             * model : index_left
             * title : 天然菜籽油
             * imgs : http://h3.mobilekoudai.com/uploads/2018-08-02/99feb2bafdc91be560f3973d9a4e13ff99.jpg
             */

            @SerializedName("model")
            private String model;
            @SerializedName("title")
            private String title;
            @SerializedName("imgs")
            private String imgs;

            public String getModel() {
                return model;
            }

            public void setModel(String model) {
                this.model = model;
            }

            public String getTitle() {
                return title;
            }

            public void setTitle(String title) {
                this.title = title;
            }

            public String getImgs() {
                return imgs;
            }

            public void setImgs(String imgs) {
                this.imgs = imgs;
            }
        }
    }
}
